<template>
    <div class="breadCrumb">
        <router-link :to="{ name: item.name }" href="" v-for="item in data" :key="item.name" :sparator="sparator"
            :indexs="indexs = data.length">{{ item.meta.name }}{{ data.length == 1 && data.length == indexs ? '' : '🐓' }}
        </router-link>
        {{ indexs }}
    </div>
</template>

<script setup>
import { ref, toRefs, watchEffect } from "vue"
let props = defineProps({
    data: {
        type: Array,
        default() {
            return []
        }
    },
    sparator: {
        type: String,
        default() {
            return "🐓"
        }
    }
})
let indexs = ref("")
let { data, sparator } = toRefs(props)
</script>

<style scoped>
.breadCrumb {
    border: 1px solid #ccc;
    margin: 10px 0;
}

.breadCrumb a {
    font: size 16px;
    font-weight: 700;
    color: black;
    margin: 0 10px;
    text-decoration: none;
}
</style>